-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add discussions tab to community page #645
Add discussions tab to community page #645
Conversation
src="${REPL_DEVHUB}/widget/devhub.components.organism.Feed" | ||
props={{ | ||
showFlagAccountFeature: true, | ||
action: "repost", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is mostly a copy of the Announcements.jsx
feed only difference is that it looks for repost
instead of post
. And the Compose component call createDiscussion in the devhub-contract.
…e/584-discussions-front-end
This issue is supporting PR [#645](NEAR-DevHub/neardevhub-bos#645) @frolvlad @ailisp I would like to get some feedback on my approach. I assumed that in order to create `discussions.${handle}.community.devhub.near` the `${handle}.community.devhub.near` account needs to be an factory in itself. I added this image help describe what I did with some common terminology. <img width="1072" alt="Screenshot 2024-01-23 at 17 31 22" src="https://github.com/NEAR-DevHub/neardevhub-contract/assets/28901891/7b0b1145-0828-4e32-9a1d-cb0ba32354f9"> I added a `set_discussions_community_socialdb` function so the user can post on socialdb from the devhub.near contract. This uses `get_devhub_discussions_account` which retrieves `discussions.<handle>.community.devhub.near`. To support that I added a `create_discussions_account` function to the community contract. So the community contract is in essence a discussions factory. I copied most of what was the community contract to the discussions contract with some minor tweaks since it is a level down in subaccounts. In file `community/src/lib.rs` line 9 and 70 a PUBkey from devhub.near is used to give control to make posts on socialDB. Should this be devhub.near?
let blockHeight = response[context.accountId]["post"][":block"]; | ||
repostOnDiscussions(blockHeight); | ||
}) | ||
.catch(console.log); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good on processing user discussions!
For now we use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bugs:
- If posting to social.near does not require redirect, create_discussion is not triggerred
- Postng to social.near is not visible (see transaction, see it not visible on the feed) - you have to include
index
update in theset
call
@frol fixed them! It is ready to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compose block should show my avatar and account id instead of the discussions account avatar and account id. (in announcements we wanted to display the announcements account, but in discussions we want to display the user account since it will be posted on behalf of the user)
P.S. We need to set some avatar and meaningful bio with the reference to the announcements account and DevHub for the discussions accounts
Co-authored-by: Vlad Frolov <[email protected]>
…naar/neardevhub-widgets into feature/584-discussions-front-end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Resolves #584
Right now the preview doesn't work since it needs to link a different contract first
PREVIEW
This issue is blocked on the contract side by PR: #88
Acceptance Criteria
DevHub community page requirements:
near.org and near social requirements:
Backend storage requirements: